package se.statemachine.fsm.interfacestyle.state;

import se.statemachine.fsm.interfacestyle.Turnstile;
import se.statemachine.fsm.interfacestyle.TurnstileFSM;
import se.statemachine.fsm.interfacestyle.TurnstileState;

public class LockedState implements TurnstileState {

	public void coin(Turnstile turnstile) {
		if(turnstile.unlock()){
			TurnstileFSM.setState(TurnstileFSM.unlocked);	
		}				
	}

	public void pass(Turnstile turnstile) {
		turnstile.alarm();
	}
	
	public String toString(){
		return "LockedState";
	}

}
